/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "sciftbactcont")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Sciftbactcont.findAll", query = "SELECT s FROM Sciftbactcont s"),
    @NamedQuery(name = "Sciftbactcont.findBySciftbactcontid", query = "SELECT s FROM Sciftbactcont s WHERE s.sciftbactcontid = :sciftbactcontid"),
    @NamedQuery(name = "Sciftbactcont.findByNombre", query = "SELECT s FROM Sciftbactcont s WHERE s.nombre = :nombre"),
    @NamedQuery(name = "Sciftbactcont.findByFecharegistro", query = "SELECT s FROM Sciftbactcont s WHERE s.fecharegistro = :fecharegistro"),
    @NamedQuery(name = "Sciftbactcont.findByObservaciones", query = "SELECT s FROM Sciftbactcont s WHERE s.observaciones = :observaciones")})
public class Sciftbactcont implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "sciftbactcontid")
    private Integer sciftbactcontid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 400)
    @Column(name = "nombre")
    private String nombre;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecharegistro")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecharegistro;
    @Size(max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @JoinColumn(name = "sciftbcontratid", referencedColumnName = "sciftbcontratid")
    @ManyToOne(optional = false)
    private Sciftbcontrat sciftbcontratid;
    @JoinColumn(name = "pytctbactcompid", referencedColumnName = "pytctbactcompid")
    @ManyToOne(optional = false)
    private Pytctbactcomp pytctbactcompid;
    @JoinColumn(name = "pydgtbresponsaid", referencedColumnName = "pydgtbresponsaid")
    @ManyToOne(optional = false)
    private Pydgtbresponsa pydgtbresponsaid;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "sciftbactcontid")
    private Collection<Sciftbytacttec> sciftbytacttecCollection;

    public Sciftbactcont() {
    }

    public Sciftbactcont(Integer sciftbactcontid) {
        this.sciftbactcontid = sciftbactcontid;
    }

    public Sciftbactcont(Integer sciftbactcontid, String nombre, Date fecharegistro) {
        this.sciftbactcontid = sciftbactcontid;
        this.nombre = nombre;
        this.fecharegistro = fecharegistro;
    }

    public Integer getSciftbactcontid() {
        return sciftbactcontid;
    }

    public void setSciftbactcontid(Integer sciftbactcontid) {
        this.sciftbactcontid = sciftbactcontid;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public Date getFecharegistro() {
        return fecharegistro;
    }

    public void setFecharegistro(Date fecharegistro) {
        this.fecharegistro = fecharegistro;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    public Sciftbcontrat getSciftbcontratid() {
        return sciftbcontratid;
    }

    public void setSciftbcontratid(Sciftbcontrat sciftbcontratid) {
        this.sciftbcontratid = sciftbcontratid;
    }

    public Pytctbactcomp getPytctbactcompid() {
        return pytctbactcompid;
    }

    public void setPytctbactcompid(Pytctbactcomp pytctbactcompid) {
        this.pytctbactcompid = pytctbactcompid;
    }

    public Pydgtbresponsa getPydgtbresponsaid() {
        return pydgtbresponsaid;
    }

    public void setPydgtbresponsaid(Pydgtbresponsa pydgtbresponsaid) {
        this.pydgtbresponsaid = pydgtbresponsaid;
    }

    @XmlTransient
    public Collection<Sciftbytacttec> getSciftbytacttecCollection() {
        return sciftbytacttecCollection;
    }

    public void setSciftbytacttecCollection(Collection<Sciftbytacttec> sciftbytacttecCollection) {
        this.sciftbytacttecCollection = sciftbytacttecCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (sciftbactcontid != null ? sciftbactcontid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Sciftbactcont)) {
            return false;
        }
        Sciftbactcont other = (Sciftbactcont) object;
        if ((this.sciftbactcontid == null && other.sciftbactcontid != null) || (this.sciftbactcontid != null && !this.sciftbactcontid.equals(other.sciftbactcontid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Sciftbactcont[ sciftbactcontid=" + sciftbactcontid + " ]";
    }
    
}
